-- GENERATED SPELL FOR [Cenarion Protector] --


function spell0_3797(pUnit, Event) --@Bear Form,Self--
pUnit:FullCastSpellOnTarget(7090,pUnit)
pUnit:RegisterEvent('Sorts_3797', 0, 1)
end

function spell1_3797(pUnit, Event) --@Demoralizing Roar,Self--
pUnit:FullCastSpellOnTarget(15727,pUnit)
pUnit:RegisterEvent('Sorts_3797', 30250, 1)
end

function spell2_3797(pUnit, Event) --@Rejuvenation,n/a--
pUnit:FullCastSpellOnTarget(1430,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_3797', 12000, 1)
end

function Sorts_3797(pUnit, Event)
local choix_sorts_3797 = math.random(0, 2)
if choix_sorts_3797 == 0 then
pUnit:RegisterEvent('spell0_3797', 1, 1)
end
if choix_sorts_3797 == 1 then
pUnit:RegisterEvent('spell1_3797', 1, 1)
end
if choix_sorts_3797 == 2 then
pUnit:RegisterEvent('spell2_3797', 1, 1)
end
end

function mob3797_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_3797', math.random(1500, 3000), 1)
end

function mob3797_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3797_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3797_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(3797, 1, 'mob3797_Action')
RegisterUnitEvent(3797, 2, 'mob3797_Leave')
RegisterUnitEvent(3797, 3, 'mob3797_Kill')
RegisterUnitEvent(3797, 4, 'mob3797_Die')
